const axios = require('axios')

//获取我喜欢的歌曲列表 以数组形式返回
async function likelist(id) {
    var info = await axios({
        withCredentials: true,
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/likelist',
        port: 3000,
        params: {
            uid: id
        }
    })
    return info
}

//获取歌曲详细信息
async function songDetails(id) {
    var info = await axios({
        withCredentials: true,
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/song/detail',
        port: 3000,
        params: {
            ids:id
        }
    })
    return info
}

//获取用户的歌单
async function getSongList(id) {
    var info = await axios({
        withCredentials: true,
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/user/playlist',
        port: 3000,
        params: {
            uid: id
        }
    })
    return info
}

//获取歌单详情描述
description
async function description(id) {
    var info = await axios({
        withCredentials: true,
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/playlist/detail',
        port: 3000,
        params: {
            id: id
        }
    })
    return info
}


//获取用户订阅的电台
async function getRadio(id) {
    var info = await axios({
        withCredentials: true,
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/dj/sublist',
        port: 3000,
    })
    return info
}

//获取我喜欢的专辑
async function loveAlbum() {
    var info = await axios({
        withCredentials: true,
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/album/sublist',
        port: 3000
    })
    return info
}

//获取专辑内容
async function albumContent(id) {
    var info = await axios({
        withCredentials: true,
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/album',
        port: 3000,
        params: {
            id: id
        }
    })
    return info
}

//获取专辑动态信息
async function albumDynamic(id) {
    var info = await axios({
        withCredentials: true,
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/album/detail/dynamic',
        port: 3000,
        params: {
            id: id
        }
    })
    return info
}

//获取歌单内容
async function songsDynamic(id) {
    var info = await axios({
        withCredentials: true,
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/playlist/detail',
        port: 3000,
        params: {
            id: id
        }
    })
    return info
}
//获取歌曲播放url
async function playUrl(id) {
    var info = await axios({
        withCredentials: true,
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/song/url',
        port: 3000,
        params: {
            id: id
        }
    })
    return info
}

//获取歌曲歌词
async function getText(id) {
    var info = await axios({
        withCredentials: true,
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/lyric',
        port: 3000,
        params: {
            id: id
        }
    })
    return info
}

//获取歌曲评论
async function getComment(id) {
    var info = await axios({
        withCredentials: true,
        method: 'get',
        baseURL: 'http://jd.cctv005.com',
        url: '/comment/music',
        port: 3000,
        params: {
            id: id,
            limit:1
        }
    })
    return info
}
export default {
    likelist,
    songDetails,
    getSongList,
    loveAlbum,
    getRadio,
    albumContent,
    albumDynamic,
    playUrl,
    songsDynamic,
    getText,
    getComment
}